package domain;

import java.sql.Date;

/*
学生对象，封装学生的信息：姓名、性别、出生日期、密码、学号（学号就是数据库中自动生成的sid，
初始化时不设置学号，当数据库生成后再返回数据库中的sid作为学号封装)
 */
public class Student {
    String name;
    String gender;
    Date date;
    int id;

    public Student(String name, String gender, Date date, int id) {
        this.name = name;
        this.gender = gender;
        this.date = date;
        this.id = id;
    }

    public Student(String name, String gender, Date date) {
        this.name = name;
        this.gender = gender;
        this.date = date;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return this.gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Date getDate() {
        return this.date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public int getId() {
        return this.id;
    }

    public void setId(int id) {
        this.id = id;
    }


    @Override
    public String toString() {
        return "该学生信息：" +"学号：" + id +
                ", 姓名：'" + name + '\'' +
                ", 性别：'" + gender + '\'' +
                ", 出生日期：'" + date + '\'';
    }
}
